'use strict';
const { RUN_ACT, ROLL_ACT, JUMP_ACT, JUMP_END, ROLL_END } = require('../utils/const');

class Hero {
    constructor() {
        // private state variable
        this._state = RUN_ACT;
    }
    onRunState(isEnter) {
        if(isEnter) {
            this._state = RUN_ACT;
        }
    }
    onJumpState(isEnter) {
        if(isEnter) {
            this._state = JUMP_ACT;
        } else {
            this._state = JUMP_END;
        }
    }
    onRollState(isEnter) {
        if(isEnter) {
            this._state = ROLL_ACT;
        } else {
            this._state = ROLL_END;
        }
    }
    state() {
        return this._state;
    }
}

const exports = {
    Hero,
};

module.exports = exports;